Home

Operator Usage

Name

unlearn

Description

unlearn[op1, op2, ..., opn] sp
unlearn[*] sp
unlearn the given operator(s) for all the kets in sp
if * is used, then unlearn all supported operators, ie, everything
In some cases where an object has a lot of learn rules, it could be slow
The above is the constant operator version, here is the dynamic version:
unlearn(|op: foo-1> + |op: foo-2> + ...) list-of |kets>


Examples

-- load some toy knowledge:
load fred-sam-friends.sw3

-- see what we know:
dump verbose
    ------------------------------------------
    |context> => |Fred Sam friends>

    supported-ops |Fred> => |op: friends> + |op: age>
    friends |Fred> => |Jack> + |Harry> + |Ed> + |Mary> + |Rob> + |Patrick> + |Emma> + |Charlie>
    age |Fred> => |32>

    supported-ops |Sam> => |op: friends> + |op: age>
    friends |Sam> => |Charlie> + |George> + |Emma> + |Jack> + |Robert> + |Frank> + |Julie>
    age |Sam> => |34>
    ------------------------------------------

-- now delete the age operator for Fred:
unlearn[age] |Fred>

-- see what we now know:
dump verbose
    ------------------------------------------
    |context> => |Fred Sam friends>

    supported-ops |Fred> => |op: friends>
    friends |Fred> => |Jack> + |Harry> + |Ed> + |Mary> + |Rob> + |Patrick> + |Emma> + |Charlie>

    supported-ops |Sam> => |op: friends> + |op: age>
    friends |Sam> => |Charlie> + |George> + |Emma> + |Jack> + |Robert> + |Frank> + |Julie>
    age |Sam> => |34>
    ------------------------------------------

-- now delete the friends operator for Fred:
unlearn[friends] |fred>

-- see what we now know:
dump verbose
    ------------------------------------------
    |context> => |Fred Sam friends>

    supported-ops |Fred> => |>

    supported-ops |Sam> => |op: friends> + |op: age>
    friends |Sam> => |Charlie> + |George> + |Emma> + |Jack> + |Robert> + |Frank> + |Julie>
    age |Sam> => |34>
    ------------------------------------------


See also

Operator type

superposition compound context, context function 1